Skip to content

Commit

Permalink
Merge pull request #4986 from open-formulieren/chore/4908-document-bo…
Browse files Browse the repository at this point in the history
…olean-icons

📝 Document boolean icons in admin
  • Loading branch information
viktorvanwijk authored Jan 6, 2025
2 parents c375347 + 8efb9e5 commit 105dcdf
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webpack = require('webpack');

const config = {
core: {
Expand Down Expand Up @@ -51,6 +52,8 @@ const config = {
path.resolve(__dirname, '../src/openforms/js'),
];

config.plugins.push(new webpack.DefinePlugin({STATIC_URL: JSON.stringify('./static/')}));

if (isEnvProduction) {
config.plugins.push(new MiniCssExtractPlugin({filename: 'static/bundles/[name].css'}));
}
Expand Down
16 changes: 16 additions & 0 deletions src/openforms/js/components/admin/BooleanIcons.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {ArgTypes, Canvas, Meta} from '@storybook/addon-docs';

import * as BooleanIconsStories from './BooleanIcons.stories';

<Meta of={BooleanIconsStories} />

# Boolean icons

You can use boolean icons to quickly represent the state of a boolean. Booleans are tri-state:
`true`, `false` or `null`.

<Canvas of={BooleanIconsStories.Yes} />

<Canvas of={BooleanIconsStories.No} />

<Canvas of={BooleanIconsStories.Unknown} />
18 changes: 18 additions & 0 deletions src/openforms/js/components/admin/BooleanIcons.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import BooleanIcon, {IconNo, IconUnknown, IconYes} from './BooleanIcons';

export default {
title: 'Admin / Django / BooleanIcons',
component: BooleanIcon,
};

export const Yes = {
render: () => <IconYes />,
};

export const No = {
render: () => <IconNo />,
};

export const Unknown = {
render: () => <IconUnknown />,
};

0 comments on commit 105dcdf

Please sign in to comment.